# -*- coding: utf-8 -*-
# !/usr/bin/env python
# !/usr/bin/python3
# @Time    : 2021/3/13 22:09
# @Author  : buke-freedom
# @File    : python_email.py
"""
# @description：

"""
import smtplib

from email.mime.text import MIMEText   # 邮件正文
from email.header import Header  # 邮件头

# login
smtp_obj = smtplib.SMTP_SSL("smtp.qq.com",465)# 发件人邮箱中的SMTP服务器，端口号
smtp_obj.login("764136656@qq.com", "xxxxxxxxxx")# 括号中对应的是发件人的邮箱账号、邮箱密码

#设置邮件头信息
msg = MIMEText("124327486321098546321y09853215235235235235213","plain","utf-8")
msg["From"] =  Header("来自XX的问候","utf-8") #发送者
msg["To"] = Header("我就是我","utf-8")# 接收者
msg["Subject"] = Header("dedwqewefwe","utf-8")#主题

#发送
smtp_obj.sendmail("764136656@qq.com","doublechuan@outlook.com",msg.as_string())
